spb/datacenterindex
Public
HTML 53.9%
TypeScript 44.5%
JavaScript 0.6%
SQL 0.5%
1import { notFound } from "next/navigation";2import type { ReactNode } from "react";3import { api } from "@/lib/api";45/**6 * Existence gate: a 404 from the API becomes a real HTTP 404 here, before the segment's loading.tsx7 * streams a 200 shell. The page re-fetches the same URL (deduplicated by the fetch cache).8 */9export default async function OperatorLayout({ children, params }: { children: ReactNode; params: Promise<{ slug: string }> }) {10 const { slug } = await params;11 const r = await api.operator(slug);12 if (!r.ok && r.status === 404) notFound();13 return <>{children}</>;14}15